import UnitCommon from 'code/Core/Common/UnitCommon';
import AbilityBase from 'code/Scripts/Abilities/base/AbilityBase';
/**
 * 暗牙
 **/
export default class BossSpell_DarkTeeth extends AbilityBase {
    static instance: BossSpell_DarkTeeth;
    constructor(id: string = 'Mzw3') {
        super(id);
        BossSpell_DarkTeeth.instance = this;
        this.init();
        EventManager.onTakeAttack(this.onSpellEffect.bind(this));
    }
    init() {}
    cast<T extends Object = any>(tarX: number, tarY: number, source: unit, target: unit, data?: T): void {}
    onSpellEffect(d: DamageEventData) {
        if (GetUnitAbilityLevel(d.source, this.id) == 0) return;
        let dmg = UnitCommon.取攻击(d.source);
        DamageSystemInstance.applyDarkDamage(d.target, d.source, dmg);
    }
}
